package space.edge.d.demo.qrcode.codescanner.scanner;

import space.edge.d.demo.qrcode.common.BinaryBitmap;
import space.edge.d.demo.qrcode.common.DecodeHintType;
import space.edge.d.demo.qrcode.common.Result;

import java.util.Map;
import java.util.concurrent.CountDownLatch;

/**
 * Created by gsl on 2017/11/4.
 */

public class CodeThread extends Thread {

    boolean quit;
    BinaryBitmap binaryBitmap;
    Map<DecodeHintType, ?> hints;
    CountDownLatch latch;

    Object lockObj;

    protected Result result;

    public void reset(CountDownLatch latch, BinaryBitmap binaryBitmap) {
        reset(latch, binaryBitmap, null);
    }

    public void reset(CountDownLatch latch, BinaryBitmap binaryBitmap, Map<DecodeHintType, ?> hints) {
        this.latch = latch;
        this.binaryBitmap = binaryBitmap;
        this.hints = hints;
    }

    public Result getResult() {
        return result;
    }

    public void quit() {
        quit = true;
    }
}
